<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./lib/react.development.js"></script>
    <script src="./lib/react-dom.development.js"></script>
    <script src="./lib/babel.min.js"></script>
</head>
<body>
<div id="root">

</div>

</body>
<script type="text/babel">
    const root = ReactDOM.createRoot(document.querySelector("#root"));
    const boyBookList = [
        {
            id: 1210499,
            bookName: "西周长歌",
            author: "湛兮若存"
        },
        {
            id: 1210491,
            bookName: "身处末世：低调不成后信手斩龙",
            author: "玄爷 "
        }
    ]
    const girlBookList = [
        {
            id: 12929,
            bookName: "快穿之绝美白莲在线教学",
            author: "坚果核 "
        },
        {
            id: 12920,
            bookName: "转正难，千亿总裁面临辞退",
            author: "夏之枫林"
        }
    ]

    const App = function(){
        return (
            <div>
                <h3>小说官网</h3>
                <hr/>
                <Book color={"blue"} title={"男生必读"} bookList={boyBookList}/>
                <hr/>
                <Book color={"pink"} title={"女生爱看"} bookList={girlBookList}/>
            </div>
        )
    }
    const Book = function(props){
        const {color} = props;
        return (
            <>
                <h4 style={{color}}>{props.title}</h4>
                {
                    props.bookList.map(item=><h5 key={item.id}>《{item.bookName}》作者：{item.author}</h5>)
                }
            </>
        )
    }
    root.render(<App/>)
</script>
</html>